<template>
  <mei-layout style="height:68vh">
    <mei-layout-left title="资产字段" width="240px">
      <sysAssetA1List
        ref="a1list"
        @onSelect="onSelect"
        @onSelectClear="onSelectClear"
        :showselect="true"
      ></sysAssetA1List>
    </mei-layout-left>
    <mei-layout-main title="资产列表" overflow>
      <update ref="update" :tableData="updateData"></update>
    </mei-layout-main>
  </mei-layout>
</template>

<script>
import sysAssetA1List from "../assetA1Search/sysAssetA1List";
import update from "./update";
export default {
  name: "batchupdate",
  data() {
    return {
      //页面控制
      page: {},
      //数据
      data: {}
    };
  },
  //外部属性
  props: {
    //批量修改的数据
    updateData: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  //内部方法
  methods: {
    async initPage() {},
    onLeftToggle() {},
    onSelect(rows, row, selected) {
      const update = this.$refs.update;
      if (selected) {
        update.addItem(row);
      } else {
        update.removeItem(row);
      }
    },
    onSelectClear() {
      const update = this.$refs.update;
      update.clearItem();
    }
  },
  //组件
  components: {
    sysAssetA1List,
    update
  },
  //初始化 异步加async await
  mounted() {
    this.initPage();
  },
  //计算属性
  computed: {},
  //监视
  watch: {}
};
</script>

<style lang="scss" scoped>
@import "@/style/base.scss";
</style>
